<template>
  <div class="brandlist">
    <div class="title">品牌制造商直供</div>
    <ul>
      <li v-for="item in brandList" :key="item.id" @click="onClick(item.id)">
        <img v-lazy="item.pic_url" width="100%" style="display: block;" alt="">
        <h4>{{item.name}}</h4>
        <p>{{item.floor_price | filtermoney}}</p>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'BrandList',
  props: ['brandList'],
  methods: {
    onClick(id) {
      this.$router.push("/brand/" + id);
    }
  }
}
</script>

<style lang="less" scoped>
.brandlist {
  background: #fff;
  margin-top: 20px;
  margin-bottom: 20px;
}
.title {
  text-align: center;
  height: 50px;
  line-height: 50px;
  font-size: .2rem;
}
ul {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  li {
    width: 49%;
    margin-bottom: 2px;
    position: relative;
    h4 {
      position: absolute;
      left: .1rem;
      top: 10px;
      font-weight: normal;
    }
    p {
      position: absolute;
      left: .1rem;
      top: 40px;
      color: darkred;
    }
  }
}
</style>